var fs=require("fs")

var json = eval("("+fs.readFileSync("./ll.json")+")")

var frames = json.frames
var out = []
var fs = require("fs");
require('./json2.js')

for(var i in frames)
{	
	var id = i.substr(0, 6)
    var idx= out.length
    out[idx] = {}
    out[idx].url = "http://d39qjxt7coa7gg.cloudfront.net/ad688/creatives/" +id + "/" +i
    out[idx].width =frames[i].sourceSize.w
    out[idx].height =frames[i].sourceSize.h

   // fs.writeFile(i.substr(0, 6)+'.txt', JSON.stringify(out[idx]))
    
   fs.appendFile(id+'.txt', JSON.stringify(out[idx]) + ',')

}
